#!/bin/sh

. ./build_directory


VERSION_TYPE=beta
version=$1


datestr=$(date +%Y%m%d) 
timestr=$(date +%H%M%S)

print $1
print $#

check_useage $#

echo "Package:slcd-${VERSION_TYPE}-${version}-${datestr}-i386.deb" > ./control
echo "Priority: extra" >> ./control
echo "Section: x11" >> ./control
echo "Installed-Size: 250.5MB" >> ./control
echo "Maintainer: lin" >> ./control
echo "Architecture: i386" >> ./control
echo "Version: ${version}" >> ./control
echo "Depends:" >> ./control
echo "Description:${VERSION_TYPE}-${version}-${datestr}  - PISPlayer system." >> ./control
echo " *create data:20121011" >> ./control
echo " *PISPlayer system." >> ./control
echo " *Running environment:qt-4.6.4." >> ./control

cp ./control ${DEB_DIR}/DEBIAN/
rm ${DEB_DIR}/DEBIAN/*~
chmod 0755 ${DEB_DIR}/DEBIAN
chmod 0755 ${DEB_DIR}/DEBIAN/*

print "cp ${PROGRAM_RELEASE_PATH}/${PROGRAME_NAME}  ${DEB_DIR}/usr/share/glink/slcd/"
cp ${PROGRAM_RELEASE_PATH}/${PROGRAME_NAME}  ${DEB_DIR}/usr/share/glink/slcd/

rm ${RELEASE_DIR}/slcd-${VERSION_TYPE}-${version}-${datestr}-i386.deb

print "dpkg -b ${DEB_DIR} ${RELEASE_DIR}/slcd-${VERSION_TYPE}-${version}-${datestr}-i386.deb"
dpkg -b ${DEB_DIR} ${RELEASE_DIR}/slcd-${VERSION_TYPE}-${version}-${datestr}-i386.deb

print "================= build finish ================= "
